<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <ul>

    </ul>
    <script>
        //1. 箭头函数，写法简洁
        let test = () => "666"
        console.log(test()) //666

        let arr = ["aaa", "bbb", "ccc"]
        let newarr = arr.map(item => `<li>${item}</li>`)
        console.log(newarr) //['<li>aaa</li>', '<li>bbb</li>', '<li>ccc</li>']

        //2. 只有return可以省略，如果返回对象则需要加圆括号
        let test2 = () => ({
            name: "twj",
            age: 100
        })
        console.log(test2()) //{name: 'twj', age: 100}

        //3. 如果只有一个参数，可以省略()
        let newarr2 = arr.map(item => `<li>${item}</li>`)
        console.log(newarr2) //['<li>aaa</li>', '<li>bbb</li>', '<li>ccc</li>']

        //4. 无法访问arguments，无法new
        let test3 = () => {
            console.log(arguments) //无法访问的哦!
        }
        //test3(1, 2, 3, 4) //ReferenceError: arguments is not defined
        //new test3() //TypeError: test3 is not a constructor
    </script>
</body>

</html>